<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>新增链接信息</title>
	<include file="Public:header" />
	<style type="text/css">
		input,textarea{width:190px; border:1px solid #ccc; padding:2px;}
		select{width:190px; border:1px solid #ccc; height:25px; padding:2px;}
	</style>
	<script type="text/javascript">
		function chkfrm()
		{
			if($('#title').val()=='')
			{
				$.messager.show({title:'提示',msg:'请输入名称',timeout:5000,showType:'slide'});
				return false;
			}
			if($('#classid').val()=='')
			{
				$.messager.show({title:'提示',msg:'请请选择一个类别',timeout:5000,showType:'slide'});
				return false;
			}
			if($('#orderid').val()=='')
			{
				$.messager.show({title:'提示',msg:'请正确输入排序号，只能为数字',timeout:5000,showType:'slide'});
				return false;
			}
			$('#form1').submit();
		}
	</script>
</head>
<body class="">
	<div class="demo-info space-out-10px">
		<div class="demo-tip icon-tip"></div>
		<div>链接主要用于前台的显示，可以设置友情链接，合作伙伴等</div>
	</div>
	<form id="form1" method="post" action="{:U('Link/data_add_save')}">
		<table class="space-out-10px">
		<tr>
		<td>链接名称：</td><td><input type="text" id="title" name="title" class="easyui-validatebox" required="true" /></td>
		</tr>
		<tr>
		<td>所属类别：</td><td><select id="classid" name="classid" class="easyui-combobox" editable="false" style="width:190px;">
								<option value='0'>顶级类别</option>
								<volist name='datalist' id="datalist">
								<option value='{$datalist["id"]}'><for start="2" end="$datalist['count']">|----</for>{$datalist['classname']}</option>
								</volist>
								</select>
								<script type="text/javascript">$("#classid").attr("value","{$classid}");</script>
								</td>		
		</tr>
		<tr>
		<td>描述：</td><td><input type="text" id="note" name="note" /></td>
		</tr>
		<tr>
		<td>图片：</td><td><input type="text" id="picurl" name="picurl" />
		<a href="javascript:;" class="easyui-linkbutton" iconCls="icon-up" onclick="open_upload_window('picurl')">新上传</a>
		</td>
		</tr>
		<tr>
		<td>链接：</td><td><input type="text" id="linkurl" name="linkurl" class="easyui-validatebox" required="true" /></td>
		</tr>
		<tr>
		<td>排序号：</td><td><input type="text" id="orderid" name="orderid" value="{$orderid}" class="easyui-validatebox" required="true" /></td>
		</tr>
		<tr>
		<td>&nbsp;</td><td>
		<input type="hidden" id="parentid" name="parentid" value="0" />
		<input type="hidden" id="parentstr" name="parentstr" value=",0," />
		<input type="hidden" id="status_flg" name="status_flg" value="Y" />
		<a href="javascript:;" class="easyui-linkbutton" iconCls="icon-save" onclick="chkfrm()">保存</a>
		<a href="{:U('Link/data_list')}" class="easyui-linkbutton" iconCls="icon-undo">取消</a>
		</td>
		</tr>
		</table>
	</form>
	<include file="Public:upload" />

</body>
</html>
